package main

// 导入包
import (
	"database/sql"
	"fmt"

	_ "github.com/go-sql-driver/mysql"
)

func main() {
	// 配置数据库的一些源信息
	dsn := "dcroot:WEVkyOHPFjOyvbSGXU2fwVHXcoVs6Val@tcp(rm-bp18rv74y8t047n17-l4.mysql.rds.aliyuncs.com:3306)/dc_v2_device?charset=utf8mb4&parseTime=True&loc=Local"

	// 打开连接
	db, err := sql.Open("mysql", dsn)
	if err != nil {
		panic(err)
	}
	fmt.Println("connect success======")
	defer db.Close()
}
